using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.IO;

namespace Utils.Explorer
{
    public class Files
    {
        public static ArrayList GetFileNames(ArrayList filespath)
        {
            return GetFileNames(filespath, true);
        }

        public static ArrayList GetFileNames(ArrayList filespath, bool withoutExtension)
        {
            ArrayList result = new ArrayList();
            
            foreach (string str in filespath)
            { 
                if(withoutExtension)
                    result.Add(Path.GetFileNameWithoutExtension(str));
                else
                    result.Add(Path.GetFileName(str));
                    
            }

            return result;
        }

        public static ArrayList GetFilesInfo(string directory, string extension)
        { 
            ArrayList result = new ArrayList();
            DirectoryInfo dir = new DirectoryInfo(directory);

            FileInfo[] files = dir.GetFiles("*"+extension);
            result.AddRange(files);

            return result;
        }
    }
}
